package mytest.bb;

import sde.actor.Actor;
import sde.actor.Message;
import sde.actor.MessageIF;

public interface BufferIF extends MessageIF{
	
	public static class Get extends Message{
		
		private Actor sender;
		
		public Get(Actor sender){
			this.sender=sender;
		}
		
		public void reply(int val, double time){
			sender.send(new Get.Reply(val), time);
		}
		
		public static class Reply extends Message{
			
			private int val;
			
			public int getVal(){
				return val;
			}
			
			public void setVal(int val){
				this.val=val;
			}
			
			public Reply(){}
			
			public Reply(int val){
				this.val=val;
			}
		}
	}
	
	public static class Put extends Message{
		
		public static class Reply extends Message{}
		
		private Actor sender;
		
		private int val;
		
		public void reply(double time){
			sender.send(new Put.Reply(), time);
		}

		public Put(Actor sender) {
			this.sender=sender;
		}

		public Put(Actor sender, int val) {
			this.sender=sender;
			this.val = val;
		}

		public int getVal() {
			return val;
		}

		public void setVal(int val) {
			this.val = val;
		}
	}
}
